home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
The Original Shareware 1.1
/
The Original Shareware (WeMake CDs)(Volume 1.1)(CDs, Inc)(1993).iso
/
19
/
madtrb11.zip
/
LOGICDEV.PAS
< prev
next >
Wrap
Pascal/Delphi Source File
|
1985-11-05
|
658b
|
31 lines
PROGRAM DeviceAssignmentDemo;
{
This program demonstrates the redirection of output to different
devices, under program control.
Source: "Selecting Output Devices From A Program", TUG Lines Volume I Issue 5
Author: Dwight William Johnson
Application: All systems
}
var
FileVar: text;
InKey: char;
Input: string[40];
begin
ClrScr;
write(' (S)creen or (P)rinter output? ');
repeat
read(kbd,InKey);
InKey:=Upcase(InKey);
until InKey in ['S','P'];
writeln;
if InKey='S' then
assign(FileVar,'con:')
else
assign(FileVar,'lst:');
reset(FileVar);
readln(Input);
writeln(FileVar,Input);
end.